package com.alpha.eceasy.mall.api.dto;

import com.alpha.eceasy.mall.api.entity.MallCommodity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallCommodityDTO extends MallCommodity {
    @Schema(description = "主图轮播图")
    private String detailCover;
    @Schema(description = "主图视频")
    private String video;
    @Schema(description = "商品guid")
    private String commodityGuid;
    @Schema(description = "详情图")
    private String content;
    @Schema(description = "说明图")
    private String explain;
    @Schema(description = "商品品类guid")
    private String commodityCategoryGuid;
    @Schema(description = "产品guid")
    @NotBlank(message = "产品guid不能为空!")
    private String infoProductGuid;

    public MallCommodityDTO(MallCommoditySpecificationDTO dto) {
        BeanUtils.copyProperties(dto, this);
    }
}
